package com.xiyang.boot.controller;

import com.xiyang.boot.JavafxSpringboot2Application;
import de.felixroske.jfxsupport.FXMLController;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.stage.Stage;

import java.net.URL;
import java.util.ResourceBundle;

/**
 * @author xiyang.ycj
 * @since Dec 03, 2019 14:06:42 PM
 */
@FXMLController
public class LoginController implements Initializable {

    private Stage primaryStage;

    public Button button;

    @Override
    public void initialize(URL location, ResourceBundle resources) {
        primaryStage = JavafxSpringboot2Application.getStage();

        button.setOnAction(event -> {
            Alert alert = new Alert(Alert.AlertType.INFORMATION, "hello world");
            alert.initOwner(primaryStage);
            alert.showAndWait();
        });
    }
}
